package com.dms.wuziqi.service.serviceImpl;

import com.dms.wuziqi.mapper.LoanMapper;
import com.dms.wuziqi.pojo.Loan;
import com.dms.wuziqi.service.LoanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class LoanServiceImpl implements LoanService {
    @Autowired
    LoanMapper loanMapper;
    @Override
    public void insertLoan(String loanUse, long loan_account, Date loanDate, int loanDay, int loanUserId) {
        loanMapper.insertLoan(loanUse,loan_account,loanDate,loanDay,loanUserId);
    }

    @Override
    public List<Loan> getAllLoanByUserId(int userId) {
        List<Loan> list=loanMapper.getAllLoanByUserId(userId);
        return list;
    }

    @Override
    public Loan getLoanById(int loanId) {
        Loan loan=loanMapper.getLoanById(loanId);
        return loan;
    }

    @Override
    public List<Loan> getAllLoan() {
        List<Loan> list=loanMapper.getAllLoan();
        return  list;
    }

    @Override
    public void updateAuit(int LoanId) {
     loanMapper.updateAuit(LoanId);
    }
}
